﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Create.ascx.vb" Inherits="Control_PrintLabel_Create" %>

 <script type="text/javascript" >
     function ajaxJqueryMSDS() {
         $(function () {
             $(".TextBox:first").focus();

             $(".Date").datepicker({ dateFormat: 'dd/mm/yy' });
             $("#<%= txtBatchno.ClientID%>").blur(function () {
                 $("#<%= txtItemCode.ClientID%>").val("");
                 $("#<%= txtItemName.ClientID%>").val("");
                 $("#<%= txtVendorCode.ClientID%>").val("");
                 $("#<%= txtVendorName.ClientID%>").val("");
                 $.ajax({
                     url: '<%=ResolveUrl("~/Services/wsAutoComplete.asmx/getItemBatchNo")%>',
                     data: "{ '_batchNo': '" + $("#<%= txtBatchno.ClientID%>").val() + "'}",
                     dataType: "json",
                     type: "POST",
                     contentType: "application/json; charset=utf-8",
                     beforeSend: function () {

                     },
                     dataFilter: function (data) {
                         return data;
                     },
                     success: function (data) {
                         if (data.d != null) {
                             $.each(data.d, function (idx, obj) {
                                 var lst = obj.FullText.split("@@");


                                 if (lst.length >= 4) {

                                     $("#<%= txtItemCode.ClientID%>").val(lst[0]);
                                     $("#<%= txtItemName.ClientID%>").val(lst[1]);
                                     $("#<%= txtVendorCode.ClientID%>").val(lst[2]);
                                     $("#<%= txtVendorName.ClientID%>").val(lst[3]);
                                     $("#<%= txtNgaySanXuat.ClientID%>").focus();
                                 }

                             });

                         }
                     },
                     error: function (XMLHttpRequest, textStatus, errorThrown) {
                         //Alertbox(textStatus);
                     },
                     complete: function () {
                     }
                 });



             });

         });
     }

     function open_iframe(aURL, aWinName) {
         document.getElementById('expFile').src = aURL;
     }
         function writeSwf(swf) {
             open_window_max('Viewer.aspx?swf=' + swf, 'viewer');
         }

         function open_window_max(aURL, aWinName) {
             var wOpen;
             var sOptions;

             sOptions = 'status=no,menubar=no,scrollbars=auto,resizable=no,toolbar=no,fullscreen=yes';
             sOptions = sOptions + ',width=' + (screen.availWidth - 0).toString();
             sOptions = sOptions + ',height=' + (screen.availHeight - 0).toString();
             sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0';

             wOpen = window.open('', aWinName, sOptions);
             wOpen.location = aURL;
             wOpen.focus();
             wOpen.moveTo(0, 0);
             wOpen.resizeTo(screen.availWidth, screen.availHeight);
             return wOpen;
         }
</script>

<asp:UpdatePanel ID="uplWarehouse" runat="server">
<ContentTemplate>
<div  class="BoxField">

    <div class="HeadTitle">
         <h3>
            <asp:Label ID="Label3" runat="server" Text="PRINT LABEL" /></h3>
     </div>
   <div class="DivRequired">
       <span class="fieldRequired">&nbsp;</span>Trường yêu cầu nhập dữ liệu
   </div>
   <div class="Error">
      <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="#FF3300" />
  </div>
		<div class="DivRow">
		<div  class="DivLabel">
			<asp:Label ID="lblBatchno" CssClass="TextLabel" runat="server" Text="Batch No.:" /><span class="fieldRequired">&nbsp;</span>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtBatchno"
                Display="None" ErrorMessage="Vui lòng nhập Batch No" SetFocusOnError="True" />
		</div>
		<div  class="DivTextBox" >
			<asp:TextBox ID="txtBatchno" CssClass="TextBox" runat="server" Text="" MaxLength="50" />
		</div>
		</div>


		<div class="DivRow">
		<div  class="DivLabel">
			<asp:Label ID="Label5" CssClass="TextLabel" runat="server" Text="Item Code:" />
		</div>
		<div  class="DivTextBox" >
			<asp:TextBox ID="txtItemCode" CssClass="TextBox" runat="server" Text="" />
		</div>
		</div>

		<div class="DivRow">
		<div  class="DivLabel">
			<asp:Label ID="Label7" CssClass="TextLabel" runat="server" Text="Item Name:" />
		</div>
		<div  class="DivTextBox" >
			<asp:TextBox ID="txtItemName" CssClass="TextBox" runat="server" Text="" />
		</div>

		</div>
		<div class="DivRow">
		<div  class="DivLabel">
			<asp:Label ID="Label6" CssClass="TextLabel" runat="server" Text="Vendor Code:" />
		</div>
		<div  class="DivTextBox" >
			<asp:TextBox ID="txtVendorCode" CssClass="TextBox" runat="server" Text="" />
		</div>
		</div>

		<div class="DivRow">
		<div  class="DivLabel">
			<asp:Label ID="Label8" CssClass="TextLabel" runat="server" Text="Vendor Name:" />
		</div>
		<div  class="DivTextBox" >
			<asp:TextBox ID="txtVendorName" CssClass="TextBox" runat="server" Text="" />
		</div>
		</div>


        <div class="DivRow">
		<div  class="DivLabel">
			<asp:Label ID="Label9" CssClass="TextLabel" runat="server" Text="Ngày sản xuất:"  />
		</div>
		<div  class="DivTextBox" >
			<asp:TextBox ID="txtNgaySanXuat" CssClass="TextBox Date" runat="server" Text="" MaxLength="10" />
		</div>
		</div>


        <div class="DivRow">
		<div  class="DivLabel">
			<asp:Label ID="Label10" CssClass="TextLabel" runat="server" Text="Hạn sử dụng:"  />
		</div>
		<div  class="DivTextBox" >
			<asp:TextBox ID="txtHanSuDung" CssClass="TextBox Date" runat="server" Text="" MaxLength="10" />
		</div>
		</div>

		<div class="DivRow" style="display:none">
		<div  class="DivLabel">
			<asp:Label ID="lblNumber" CssClass="TextLabel" runat="server" Text="Number of label:"  />
		</div>
		<div  class="DivTextBox" >
			<asp:TextBox ID="txtNumber" CssClass="TextBox" runat="server" Text="" MaxLength="10" />
		</div>
		</div>







</div>
		<div class="DivRow">
		<div class="DivLabel" >&nbsp;&nbsp;&nbsp;</div>
		<div class="DivTextBox" > 
			<asp:Button ID="btnSave" runat="server" Text=" Preview " CssClass="btn"  />
			
			
            &nbsp; <asp:Button ID="btnExportWord" runat="server"  CssClass="btn" Text="Export Word"  />
            &nbsp; <asp:Button ID="btnExportPdf" runat="server"  CssClass="btn" Text="Export PDF" />

            &nbsp;<asp:Button ID="btnReset" runat="server" CausesValidation="false" CssClass="btn" Text="Làm mới" />

		</div>
		</div>

</div>
<div style="display: none">
    <iframe src="#" id="expFile">    
    </iframe>
    <asp:HiddenField ID="hidID" Value="0" runat="server" />

</div>
</ContentTemplate>
</asp:UpdatePanel>
